package com.stores.v1.security;

import com.stores.v1.entity.Person;
import com.stores.v1.model.DatabaseCommandException;
import com.stores.v1.toolset.DatabaseInitializationException;
import com.stores.v1.toolset.IDatabase;

public interface IAccessControl {

	/***
	 * 
	 * @param privilegeId
	 * @param p
	 * @return
	 * @throws DatabaseInitializationException
	 * @throws DatabaseCommandException
	 */
	public abstract boolean isAllowed() throws DatabaseInitializationException,
			DatabaseCommandException;

	/***
	 * 
	 * @return
	 */
	IDatabase getDatabase();

	/***
	 * 
	 * @param database
	 */
	void setDatabase(IDatabase database);

	/***
	 * 
	 * @return
	 */
	Person getUserContext();

	/***
	 * 
	 * @param person
	 */
	void setUserContext(Person person);

	/**
	 * 
	 * @return
	 */
	int getPrivilegeId();

	/***
	 * 
	 * @param privilegeId
	 */
	void setPrivilegeId(int privilegeId);
}